"""Build io_conf generator"""


def scons():
    """Execute build"""
    Import(['denv', 'daos_test_tgt', 'daos_epoch_io', 'daos_test_rebuild', 'daos_test_obj'])

    libraries = ['daos_common', 'daos', 'dfs', 'daos_tests', 'gurt', 'cart', 'uuid']
    libraries += ['cmocka', 'json-c', 'dpar']

    iogen = denv.SharedObject('daos_generate_io_conf.c')
    daos_gen_io_conf = denv.d_test_program('daos_gen_io_conf',
                                           [daos_test_tgt, daos_epoch_io, daos_test_rebuild,
                                            daos_test_obj, iogen],
                                           LIBS=libraries)

    ioconf = denv.SharedObject('daos_run_io_conf.c')
    daos_run_io_conf = denv.d_test_program('daos_run_io_conf',
                                           [daos_test_tgt, daos_epoch_io, daos_test_rebuild,
                                            daos_test_obj, ioconf],
                                           LIBS=libraries)
    denv.Install('$PREFIX/bin/', daos_gen_io_conf)
    denv.Install('$PREFIX/bin/', daos_run_io_conf)


if __name__ == "SCons.Script":
    scons()
